FileStorage

interface FileStorage

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Interface defining callbacks for handling events related to FileStorage within the SDK.

Properties

Link copied to clipboard
abstract val externalStorageName: String?

Get the current connected user external storage name if any.

Link copied to clipboard
abstract val externalStorageUrl: String?

Get the current connected user external storage URL if any.

Link copied to clipboard
abstract val lastConsumption: Consumption?

Get the current file storage consumption and quota associated to the connected user.

Functions

Link copied to clipboard
abstract fun cancelDownload(fileDescriptor: RainbowFileDescriptor): Boolean

Cancel the download started on the RainbowFileDescriptor. If there is a downloaded file, partial or complete, it is deleted.

Link copied to clipboard
abstract fun cancelUpload(fileDescriptor: RainbowFileDescriptor)

Cancel the upload started on the RainbowFileDescriptor.

Link copied to clipboard
abstract suspend fun copyFileDescriptorsToPersonalStorage(    fileDescriptors: List<RainbowFileDescriptor>,     hidePurpose: Boolean = false): RainbowResult<List<RainbowFileDescriptor>>

As a viewer of multiple RainbowFileDescriptors, upload a copy in the user personal storage

Link copied to clipboard
abstract suspend fun copyFileDescriptorToPersonalStorage(    fileDescriptor: RainbowFileDescriptor,     hidePurpose: Boolean = false): RainbowResult<RainbowFileDescriptor>

As a viewer of the RainbowFileDescriptor, upload a copy in the user personal storage

Link copied to clipboard
abstract suspend fun createExternalLinkForRoom(roomId: String): RainbowResult<String>

Create the external storage URL for accessing shared files within a room. Only Bubble owner can do it.

Link copied to clipboard

Deletes all previously downloaded files on the device

Link copied to clipboard
abstract suspend fun deleteAllFileDescriptors(): RainbowResult<Unit>

Deletes all RainbowFileDescriptor owned by the user

Link copied to clipboard
abstract suspend fun deleteFileDescriptor(fileDescriptor: RainbowFileDescriptor): RainbowResult<Unit>

Deletes the RainbowFileDescriptor from the server

Link copied to clipboard
abstract suspend fun deleteFileDescriptors(fileDescriptors: List<RainbowFileDescriptor>): RainbowResult<Unit>

Deletes a list of RainbowFileDescriptor from the server

Link copied to clipboard
abstract suspend fun deleteFileDescriptorsViewer(fileDescriptors: List<RainbowFileDescriptor>, viewerIdToDelete: String): RainbowResult<Unit>

Deletes a given viewer from a list of RainbowFileDescriptor

Link copied to clipboard
abstract suspend fun deleteFileDescriptorViewer(    fileDescriptor: RainbowFileDescriptor,     viewerIdToDelete: String,     deleteFileOnLastViewer: Boolean = false): RainbowResult<Unit>

Deletes a given viewer from a RainbowFileDescriptor The user must be a current viewer of the RainbowFileDescriptor, once deleted, they will no longer have access to it

Link copied to clipboard
abstract suspend fun downloadFile(fileDescriptor: RainbowFileDescriptor): RainbowResult<RainbowFileDescriptor>

Download the file from the server. This method uses the Android DownloadManager

Link copied to clipboard
abstract suspend fun fetchFileDescriptorById(    fileDescriptorId: String,     initialValue: (RainbowFileDescriptor) -> Unit? = null): RainbowResult<RainbowFileDescriptor>

Returns a RainbowFileDescriptor and fetch last data from the server

Link copied to clipboard
abstract suspend fun fetchFileInBubble(room: Room, limit: Int, offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor received in a bubble conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor received in this bubble, no results are returned.

Link copied to clipboard
abstract suspend fun fetchFileInConversation(    conversation: IRainbowConversation,     limit: Int,     offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor in a conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor in this conversation, no results are returned.

Link copied to clipboard
abstract suspend fun fetchFileReceived(limit: Int, offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of received RainbowFileDescriptor This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of received RainbowFileDescriptor, no results are returned. This method does not filters results.

Link copied to clipboard
abstract suspend fun fetchFileReceivedInBubble(room: Room, limit: Int, offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor received in a bubble conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor received in this bubble, no results are returned.

Link copied to clipboard
abstract suspend fun fetchFileReceivedInConversation(    conversation: IRainbowConversation,     limit: Int,     offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor received in a conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor received in this conversation, no results are returned.

Link copied to clipboard
abstract suspend fun fetchFileSent(limit: Int, offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of sent RainbowFileDescriptor This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of sent RainbowFileDescriptor, no results are returned. This method does not filters results.

Link copied to clipboard
abstract suspend fun fetchFileSentInBubble(room: Room, limit: Int, offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor in a bubble conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor in this bubble, no results are returned.

Link copied to clipboard
abstract suspend fun fetchFileSentInConversation(    conversation: IRainbowConversation,     limit: Int,     offset: Int): RainbowResult<List<RainbowFileDescriptor>>

Fetches a list of RainbowFileDescriptor sent in a conversation This method accept a limit and an offset parameters for pagination, when limit is set to 0, the API returns a maximum of 100 results. If offset is greater that the limit of RainbowFileDescriptor sent in this conversation, no results are returned.

Link copied to clipboard
abstract suspend fun fileOwnershipChange(fileDescriptor: RainbowFileDescriptor, ownerId: String): RainbowResult<RainbowFileDescriptor>

Drops the ownership to another Rainbow user of the same company The user must be in the same company and allowed by administrator

Link copied to clipboard
abstract suspend fun getExternalLinkForRoom(roomId: String): RainbowResult<String>

Get the external storage URL for accessing shared files within a room.

Link copied to clipboard
abstract suspend fun getExternalLoginUrl(callback: String): RainbowResult<String>

Retrieves the external storage login URL associated to the connected user.

Link copied to clipboard
abstract fun getFileDescriptorById(fileDescriptorId: String): RainbowFileDescriptor?

Returns a RainbowFileDescriptor if found in local list

Link copied to clipboard
abstract fun getFileDownloaded(fileDescriptor: RainbowFileDescriptor): File?

Retrieves the downloaded file associated to the RainbowFileDescriptor from the device

Link copied to clipboard
abstract suspend fun getUserQuotaConsumption(): RainbowResult<Consumption>

Retrieves the current file storage consumption and quota associated to the connected user.

Link copied to clipboard
abstract fun isDownloaded(fileDescriptor: RainbowFileDescriptor): Boolean

Checks if the file has already been downloaded to the device

Link copied to clipboard

Register to the listener with following triggers: onMaxQuotaReached

Link copied to clipboard

Unregister to the listener with following triggers: onMaxQuotaReached

Link copied to clipboard
abstract suspend fun uploadFiles(    fileDescriptors: List<RainbowFileDescriptor>,     viewer: RainbowFileViewer? = null,     resolution: Int? = HIGH_RESOLUTION): RainbowResult<List<RainbowFileDescriptor>>

Upload a list of files with a specific RainbowFileViewer